using Firestarter.DB.Schema.BO;
using FireStarterModeller.Test;
using Habanero.Testability;

namespace Firestarter.DB.Schema.Test.BO.TestUtils
{
    public class TestUtilsDBViewColumn
    {


        public static BOTestFactory<DBViewColumn> GetTestFactory()
        {
            return BOTestFactoryRegistry.Instance.Resolve<DBViewColumn>();
        }
        /// <summary>
        /// Creates a new saved DBColumn with a random value assigned to every property
        /// </summary>
        public static DBViewColumn CreateSavedDBColumn()
        {
            DBViewColumn dBColumn = CreateUnsavedValidDBColumn();
            dBColumn.Save();
            return dBColumn;
        }

        /// <summary>
        /// Creates a new unsaved DBColumn with a random value assigned to every property
        /// </summary>
        public static DBViewColumn CreateUnsavedValidDBColumn()
        {
            DBViewColumn dBColumn = new DBViewColumn();
            dBColumn.ColumnName = TestUtilsShared.GetRandomString();
            dBColumn.DataType = TestUtilsShared.GetRandomString();
            dBColumn.DataLength = TestUtilsShared.GetRandomInt();
            dBColumn.Nullable = TestUtilsShared.GetRandomBoolean();
            dBColumn.DefaultValue = TestUtilsShared.GetRandomString();
            dBColumn.TableID = TestUtilsDBTable.CreateSavedDBTable().TableID;
            dBColumn.IsAutoIncrementing = TestUtilsShared.GetRandomBoolean();
            dBColumn.Comment = TestUtilsShared.GetRandomString();
            dBColumn.OrdinalPosition = TestUtilsShared.GetRandomInt();
//			dBColumn.PendingChangeType = null;
            dBColumn.Approved = TestUtilsShared.GetRandomBoolean();
            return dBColumn;
        }
	    
        /// <summary>
        /// Creates a new unsaved DBColumn where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static DBViewColumn CreateUnsavedDefaultDBColumn()
        {
            DBViewColumn dBColumn = new DBViewColumn();
            return dBColumn;
        }
    }
}